package rank1400;

import java.util.ArrayList;
import java.util.List;

/**
 * 1237. 找出给定方程的正整数解
 */
public class No1237 {
    public List<List<Integer>> findSolution(CustomFunction customfunction, int z) {
        List<List<Integer>> ans = new ArrayList<>();
        for (int x = 1, y = 1000; x <= 1000 && y >= 1; ) {
            if (customfunction.f(x, y) < z) x++;
            else if (customfunction.f(x, y) > z) y--;
            else ans.add(List.of(x++, y--));
        }
        return ans;
    }

    // This is the custom function interface.
    // You should not implement it, or speculate about its implementation
    private static class CustomFunction {
        // Returns f(x, y) for any given positive integers x and y.
        // Note that f(x, y) is increasing with respect to both x and y.
        // i.e. f(x, y) < f(x + 1, y), f(x, y) < f(x, y + 1)
        public int f(int x, int y) {
            return 0;
        }
    }
}
